import __00SetRelation as sr
import _00SetFunc as ss  

#随机生成R1和R2.若R1和R2是传递的，则R1并R2是传递的
Xm,Ym,n=10,8,10 
X=set(range(Xm))
Y=set(range(Ym))
R1=sr.createrelation(X,Y,n)
R2=sr.createrelation(X,Y,n)
R1=sr.transitiverelation(X,R1)
R2= sr.transitiverelation(X,R2)
tv=True
tv=tv and sr.istransitiverelation(X,R1) and sr.istransitiverelation(X,R2)
tv=tv and sr.istransitiverelation(X,(R1&R2))
print("R1,R2",R1,R2)
print("tv",tv)